'use strict';

const path = require('path');
// const CONFIG_USER = require('./config.user');
module.exports = appInfo => {
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1542024490654_2608';

  // add your config here
  config.middleware = [];

  // mongoodb
  config.mongoose = {
    url: 'mongodb://140.143.228.29/eggmp',
    options: {},
    loadModel: true,
    app: true,
    agent: false,
  };

  config.mysql = {
    client: {
      host: '127.0.0.1',
      port: 3306,
      user: 'root',
      password: 'root',
      database: 'test_mp',
    },
    agent: true,
  };

  config.keys = 'foo';

  // sessionToken
  config.jwt = {
    secret: 'eggmp2018',
  };

  config.static = {
    prefix: '/public/',
    dir: path.join(appInfo.baseDir, 'app/public'),
    // support lazy load
    dynamic: true,
    preload: false,
    buffer: false,
  };
  return config;
};
